package com.city.itis.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.city.itis.dao.SiteDao;
import com.city.itis.domain.Site;
import com.city.itis.service.SiteService;

/***
* Site业务层实现类
* @author WY
*
*/
@Component("siteService")
public class SiteServiceImpl implements SiteService 
{
	private SiteDao siteDao;
	

	public SiteDao getSiteDao()
	{
		return siteDao;
	}

	@Resource
	public void setSiteDao(SiteDao siteDao) 
	{
		this.siteDao = siteDao;
	}

	@Override
	public int add(Site site) 
	{
		return this.siteDao.save(site);
	}

	@Override
	public int delete(Site site)
	{
		return this.siteDao.delete(site);
	}

	@Override
	public int deleteById(Integer id) 
	{
		return this.siteDao.deleteById(id);
	}
	

	@Override
	public int deleteByMemberId(Integer id) {
		return this.siteDao.deleteByMemberId(id);
	}


	@Override
	public int modify(Site site) 
	{
		return this.siteDao.update(site);
	}

	@Override
	public Site getSiteById(Integer id) 
	{
		return this.siteDao.getSiteById(id);
	}

	@Override
	public List<Site> findAll() 
	{
		return this.siteDao.findAll();
	}

	@Override
	public List<Site> findAllByCategoryNo(Integer categoryNo) 
	{
		return this.siteDao.findAllByCategoryNo(categoryNo);
	}
	
	@Override
	public Site getSiteBySiteName(String siteName) 
	{
		return this.siteDao.getSiteBySiteName(siteName);
	}


	@Override
	public List<Site> getListByCategoryAndPosition(int categoryNo, double lat,
			double lng, double area) 
   {
		return this.siteDao.getListByCategoryAndPosition(categoryNo, lat, lng, area);
	}
	
	@Override
	public List<Site> getListByNameAndPosition(String name, double lat,
			double lng, double area) {
		return this.siteDao.getListByNameAndPosition(name, lat, lng, area);
	}

	@Override
	public List<Site> listByMemberId(Integer memberId) 
	{
		return this.siteDao.listByMemberId(memberId);
	}

	

}
